 
 
 
<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- 从数据库查询页面找出数据 -->
	<link type="text/css" href="../../common/js/jquery/themes/base/ui.all.css" rel="stylesheet" />

  <form method="post" action="test.jsp" onsubmit="return check();">
  	<table  style="font-size: 13px;" cellspacing="8" cellpadding="8" width="98%">
  	  <tr>
	    <td align="right"><label for="timeFrom">查询开始时间</label></td>
	    <td><input type="text" onfocus="showDate(this)"
	     	onchange=" return checkdate()" id="timeFrom" name="timeFrom"
	     	
	     	/></td>
	    <td align="right"><label for="timeTo">查询结束时间 </label></td>
	    <td><input type="text"  onfocus="showDate(this)"
	     	onchange=" return checkdate()" id="timeTo" name="timeTo"
	     	
	     	/></td>
	   </tr>
	   <tr>
	   	    <td align="right">行业</td>
		    <td align="left" >
		    	<select id="parentTrade"  onchange="parentTradeChange(this);" style="width:120px;" name="parentTrade">
		    		<option value="">请选择</option>
		    	</select>
		    	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		    	<label for="childTrade">行业明细</label>
	        	<select id="childTrade" name="childTrade" style="width:120px;" >
	        		<option value="">默认</option>
	        	</select>
	        </td>
	        <td align="right">
	        	查询的关键字
	        </td>
	        <td>
		    	<input type="text"   onfocus="clearText(this);" onblur="resetText(this);" id="keyWord" name="keyWord" size="30px"
		    	
		    	value='空格、分号、逗号隔开'
		    	/>
		    </td>
		    <td></td>
		</tr>
		<tr>
			<td align="right">商圈</td>
			<td>
			    <select id="city" name="city" onchange="cityChange(this);" style="width:80px;">
			    </select>
			    <select id="cityArea" name="cityArea" style="width:80px;" >
			    	<option value="">默认</option>
			    </select>
				&nbsp;<input id="street" name="street"    onfocus="clearText(this);" onblur="resetText(this);" type="text"
				
		    	value='空格、分号、逗号隔开' />
			</td>
			<td align="right">查询次数大于</td>
			<td><input type="text" id="searchCount" name="searchCount" size="30px"
			
			/></td>
			
		</tr>
		<tr>
			
			<td align="right">号码归属地</td>
			<td>
				<input id="localPhone" name="localPhone" value="true" type="checkbox"  
				
				/>本地
				<input id="notLocalPhone" name="notLocalPhone" value="true" type="checkbox"
				
				/>外地
			</td>
			<td align="right">
				<input type="checkbox" value="true" name="commNameInSearch"
				
				/>
			</td>
			<td valign="middle">包括商家名</td>
		</tr>
    </table>
    <br/><br/>
   <div align="center">
		<input type="button" onclick="javascript:history.back();" value=" 上一步  " >
	 	&nbsp;&nbsp;<input type="button" onclick="javascript:window.location.href='/focusadtask.do?action=list'" value=" 取消操作 ">
		&nbsp;&nbsp;<input type="submit" id="serachBtn" value="  搜索  " title="">
    </div>
  </form>
  <script type="text/javascript">

//提交时的校验
function check(){
	
	//默认值进行过滤
 	var obj=document.getElementById('keword');
 	if(obj.value=='空格、分号、逗号隔开'){
 		obj.value=''; //不提交
 	}
 	obj=document.getElementById('street');
 	if(obj.value=='空格、分号、逗号隔开'){
 		obj.value=''; //不提交
 	}
 	document.getElementById("searchBtn").disabled=false;
 	return false;
 }
 
 /*   
   *---------------   DateSub(interval,number,date)   -----------------   
   *   DateSub(interval,number,date)   
   *   参数:interval,字符串表达式，表示要减去的时间间隔.   
   *   参数:number,数值表达式，表示要减去时间间隔的个数.   
   *   参数:date,时间对象.   
   *   返回:新的时间对象.   
   *   var   now   =   new   Date();   
   *   var   newDate   =   DateSub("d",5,now);   
   *---------------   DateAdd(interval,number,date)   -----------------   
   */
 function   DateSub(interval,number,date)   
  {      
        switch(interval)   
        {   
                case  "y"  :  {   
                        date.setFullYear(date.getFullYear()+number);   
                        return   date;   
                        break;   
                }      
                case   "m"   :   {   
                        date.setMonth(date.getMonth()-number);   
                        return   date;   
                        break;   
                }   
                case   "w"   :   {   
                        date.setDate(date.getDate()-number*7);   
                        return   date;   
                        break;   
                }   
                case   "d"   :   {   
                        date.setDate(date.getDate()-number);   
                        return   date;   
                        break;   
                }   
                case   "hh"   :   {   
                        date.setHours(date.getHours()-number);   
                        return   date;   
                        break;   
                }   
                case   "mm"   :   {   
                        date.setMinutes(date.getMinutes()-number);   
                        return   date;   
                        break;   
                }   
                case   "ss"   :   {   
                        date.setSeconds(date.getSeconds()-number);   
                        return   date;   
                        break;   
                }   
                default   :   {   
                        date.setDate(d.getDate()-number);   
                        return   date;   
                        break;   
                }   
        }   
  }   
 //显示日历控件
 function showDate(obj){
 	var now=new Date();
 	var min,max; //最大值和最小值
 	var value=document.getElementById('timeTo').value; //
 	if(value!='' && typeof(value)!=undefined && value!=null){
 		max=value;
 	}else{
 		max=now;
 	}
 	value=value=document.getElementById('timeFrom').value; //
 	if(value!='' && typeof(value)!=undefined && value!=null){
 		min=value;
 	}else{
 		min='2000-01-01';
 	}
 	if(obj.id=='timeFrom'){  //选择是开始时间
		WdatePicker({
			isShowOthers:true,
			maxDate:max,
			minDate:'2000-01-01',
			dateFmt:'yyyy-MM-dd'
			});
 	}else{//选择是结束时间
		WdatePicker({
			isShowOthers:true,
			minDate:min,
			maxDate:now,
			dateFmt:'yyyy-MM-dd'
			});
 	}
 }
 //
 function clearText(obj){
 	if (obj.defaultValue=='空格、分号、逗号隔开' || obj.value=='空格、分号、逗号隔开'){
 	 	obj.value = "";
 	 }
 }
 //
 function resetText(obj){
 	if (obj.value == ''){
 	  obj.value='空格、分号、逗号隔开';
 	}
 }
  </script>
 
